package field_method04;

public class Book {//书类
    //修饰符 数据类型 变量名
    private String bookName;
    private String author;//作者
    private String publisher;//出版社名
    private double price;//价格
    //修饰符 返回值类型 方法名 （形参列表）{}
    /*
     * 设置 书名
     * set方法 是有参数的公共方法 无返回值
     * @param bookNameParam
     */

    public void setBookName(String bookNameParam){
        System.out.println("数据传过来了：" + bookNameParam);

        bookName = bookNameParam;
    }
    /**
     * 获取书名
     * get 方法是没有参数的公共方法 有返回值
     * @return
     */
    public String getBookName(){
        return bookName;
    }
    public void setAuthor(String authorParam) {
        author = authorParam;
    }
    public String getAuthor(){
        return  author;
    }
    public  void setPublisher(String publisherParam){
        publisher =publisherParam;
    }
    public String getPublisher(){
        return publisher;
    }
    public void  setPrice(double priceParam){
        price = priceParam;
    }
    public double getPrice(){
        return  price;
    }
    public String getbookInfo(){
        return "书名" + bookName + "作者：" + author
                +"出版社名：" + publisher + "价格：" +price;
    }


}
